3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
As you've seen, a uv parameterization defines how to map one object (for example, a pixmap) onto another (typically a surface). The standard surface parameterizations defined by QuickDraw 3D all use u and v parametric values that are in the valid range 0.0 to 1.0. A custom surface parameterization, however, is free to define some other range of u and v values. When this happens, you need to indicate how you want QuickDraw 3D to handle uv values outside the valid range.
Currently, QuickDraw 3D supports two boundary-handling methods: wrapping and clamping. To wrap a shader effect is to replicate the entire effect across the mapped area. For example, to wrap a texture is to replicate the texture across the entire mapped area, as many times as are necessary to fill the mapped area. To clamp a shader effect is to replicate the boundaries of the effect across the portion of the mapped area that lies outside the valid range 0.0 to 1.0.
You can specify the boundary-handling methods of the u and v directions independently. You can call the Q3Shader_SetUBoundary function to indicate how to handle values in the u parametric direction that lie outside the valid range, and you can call the Q3Shader_SetVBoundary function to indicate how to handle values in the v parametric direction that lie outside the valid range. The default boundary-handling method is to wrap in both the u and v parametric directions.
Previous | QD3D Book | Overview | Chapter Contents | Next |